#include "InetTcpTest.h"

#include "Pacap/InetTcp.h"

using namespace Pacap;

void InetTcpTest::SetUpTestCase()
{
    std::cout << "开始InetTcpTest单元测试" << std::endl;
}

void InetTcpTest::TearDownTestCase()
{
    std::cout << "结束InetTcpTest单元测试" << std::endl;
}


TEST_F(InetTcpTest,unpack_ok){

    static const unsigned char pkt38[57] = {
        0xdf, 0x53, 0xc3, 0x51, 0x7b, 0x8d, /* .e.S.Q{. */
        0x4d, 0xcc, 0x83, 0x83, 0xf6, 0x56, 0x50, 0x18, /* M....VP. */
        0x08, 0x05, 0xd1, 0x9a, 0x00, 0x00, 0x31, 0x32, /* ......12 */
        0x33
    };
    PackType hexData( (uint8_t*)pkt38, 23 );
    InetTcp parser;
    parser.unpack(hexData);

    ASSERT_EQ( 20, parser.getDoff() );
    std::cout << parser.getData().toString() << std::endl;
}
